<?php if(!defined('HDPHP_PATH'))exit;C('SHOW_NOTICE',FALSE);?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
<head>
    <meta http-equiv="Content-Type" content="text/html;charset=UTF-8"/>
    <title>商品管理</title>
    <link type="text/css" rel="stylesheet" href="http://localhost/program/Static/hdjs/hdui.css"/>
    <link type="text/css" rel="stylesheet" href="http://localhost/program/Static/bootstrap/css/bootstrap.min.css"/>

    <!-- 载入uploadify插件-->
    <script type="text/javascript" src="http://localhost/program/Static/jquery/jquery-1.7.2.min.js"></script>
    <script type="text/javascript" src="http://localhost/program/Static/uploadify/jquery.uploadify.min.js"></script>
    <link type="text/css" rel="stylesheet" href="http://localhost/program/Static/uploadify/uploadify.css"/>

    <script type="text/javascript" src="http://localhost/program/Static/jquery/product.js"></script>
    <style type="text/css">

    .hd-h70{
        width: 80px;
        height: 60px;
    }
    #uploadList ul li{
        float: left;
    }
    .pp .ti{
    background: #31b0d5;

    }
    .lili{
        height: 200px;
        border: 1px solid red;
        display: none;
    }

    </style>

    <script type="text/javascript">
        $(function() {
            //列表图
            $('#file').uploadify({
                'formData'     : {//POST数据
                    '<?php echo session_name();?>' : '<?php echo session_id();?>',
                },
                'fileTypeDesc' : '*.png;*.gif;*.jpg',//上传描述
                'fileTypeExts' : '*.png;*.gif;*.jpg',
                'swf'      : 'http://localhost/program/Static/uploadify/uploadify.swf',
                'uploader' : '<?php echo U("upload");?>',
                'buttonText':'选择图片',
                'fileSizeLimit' : '2000KB',

                'uploadLimit' : 1,//上传文件数
                'width':65,
                'height':25,
                'successTimeout':10,//等待服务器响应时间
                'removeTimeout' : 0.2,//成功显示时间
                'onUploadSuccess' : function(file, data, response){
                    //转为json对象eval("data="+data);
                    data=$.parseJSON(data);
                    var imageUrl = data.image?data.url:'http://localhost/program/Static/image/default.png';
                    var li="<li path='"+data.path+"' url='"+data.url+"'><img src='"+imageUrl+"' class='hd-w80 hd-h70'/></li>";
                    $("#uploadList ul").prepend(li);
                    $("#list_pic").val(data.list_pic);
                }
            });
            //图册
            $('#file2').uploadify({
                'formData'     : {//POST数据
                    '<?php echo session_name();?>' : '<?php echo session_id();?>',
                },
                'fileTypeDesc' : '*.png;*.gif;*.jpg',//上传描述
                'fileTypeExts' : '*.png;*.gif;*.jpg',
                'swf'      : 'http://localhost/program/Static/uploadify/uploadify.swf',
                'uploader' : '<?php echo U("upload2");?>',
                'buttonText':'选择图片',
                'fileSizeLimit' : '2000KB',

                'uploadLimit' : 10,//上传文件数
                'width':65,
                'height':25,
                'successTimeout':10,//等待服务器响应时间
                'removeTimeout' : 0.2,//成功显示时间
                'onUploadSuccess' : function(file, data, response){
                    //转为json对象eval("data="+data);

                    data=$.parseJSON(data);
                    var imageUrl = data.image?data.url:'http://localhost/program/Static/image/default.png';
                    var li="<li path='"+data.path+"' url='"+data.url+"'><img src='"+imageUrl+"' class='hd-w80 hd-h70'/></li>";
                    $("#uploadList2 ul").prepend(li);
                    $("#logo").val(data.logo);
                }
            });
        });


    </script>
    
    <script type="text/javascript" charset="utf-8" src="http://localhost/program/Static/ueditor1_4_3/ueditor.config.js"></script>
    <script type="text/javascript" charset="utf-8" src="http://localhost/program/Static/ueditor1_4_3/ueditor.all.min.js"> </script>
    <script type="text/javascript" charset="utf-8" src="http://localhost/program/Static/ueditor1_4_3/lang/zh-cn/zh-cn.js"></script>
    <script>
        var ue = UE.getEditor('editor');
        var ue = UE.getEditor('editor2');
    </script>

</head>
<body>
<div class="wrap">
    
    <form action="" method="post" class="form-inline hd-form" enctype="multipart/form-data">
         <table class="table2 lili" style="display:block">
            <div class="tl" style="background:#5bc0de;line-height:30px">
                <a href="javascript:;" class="btn btn-info">主要信息</a>
                 <a href="javascript:;" class="btn btn-info ti">商品详细</a>
                 <a href="javascript:;" class="btn btn-info">商品属性</a>
                 <a href="javascript:;" class="btn btn-info">货品列表</a>
                 <a href="javascript:;" class="btn btn-info ti">售后服务</a>
            </div>
            <!-- 主要信息 -->
            
                <tr>
                <th class="w100">商品名称</th>
                <td>
                    <input type="text" name="name" class="w200"/>
                </td>
                <td> </td>
            </tr>
            <tr>
                <th class="w100">所属分类</th>
                <td>
                    <select name="cid" class="w200" >
                        <?php foreach ($data as $k=>$v){?>
                            <option value="<?php echo $v['cid'];?>" class="be_cate"><?php echo $v['cname'];?></option>
                        <?php }?>
                    </select>
                </td>
                <td></td>
            </tr>
            <tr>
                <th class="w100">所属品牌</th>
                <td>
                    <select name="rand_id" class="w200">
                        <?php foreach ($rand as $k=>$v){?>
                            <option value="<?php echo $v['rid'];?>"><?php echo $v['name'];?></option>
                        <?php }?>
                    </select>
                </td>
                <td></td>
            </tr>
            <tr>
                <th class="w100">单位</th>
                <td>
                    <input type="text" name="name" class="w200"/>
                </td>
                <td> </td>
            </tr>
            <tr>
                <th class="w100">易购价</th>
                <td>
                    <input type="text" name="name" class="w200"/>
                </td>
                <td> </td>
            </tr>
            <tr>
                <th class="w100">促销价</th>
                <td>
                    <input type="text" name="name" class="w200"/>
                </td>
                <td> </td>
            </tr>
            <tr>
                <th class="w100">点击次数</th>
                <td>
                    <input type="text" name="name" class="w200"/>
                </td>
                <td> </td>
            </tr>
            
            <tr>
                <th class="w100">列表图</th>
                <td width="200">
                    <div lab="uploadFile">
                        <input id="file" type="file" multiple="true">
                        <span>类型: *.jpg,*.png 大小: 2M 数量: 1</span>                            
                    </div>
                    
                </td>
                <td width="100">
                    <div id="uploadList">          
                        <ul>                                 
                        </ul>
                    </div>
                    
                 </td>
                
                 <td>
                     <th class="w100">图册</th>
                    <td width="200">
                        <div lab="uploadFile">
                            <input id="file2" type="file" multiple="true">
                            <span>类型:jpg,png 大小: 2M 数量: <10</span>                            
                        </div>
                        
                    </td>
                    <td>
                        <div id="uploadList2">          
                            <ul>                                 
                            </ul>
                        </div>
                    
                     </td>
                 </td>
            </tr>

           
            </table>
            
             <!-- 商品详情 -->
            <table class="table2 lili">
                <tr>
                    <!-- 商品详细 -编辑器-->
                
                    <td colspan="2">
                        <script id="editor" type="text/plain" style="width:100%;height:300px;"></script>
                     </td>
                    
                </tr>
                    <!-- 售后服务 -->
            
            </table>
            
            

            <!-- 商品属性 -->
            <table class="table2 lili">
        
                <tr>
                <th class="w100">商品属性</th>
                <td>
                    <select name="rid" class="w200">
                        <?php foreach ($data as $k=>$v){?>
                            <option value=" ">请选择商品类型</option>
                            <option value="<?php echo $v['cid'];?>"><?php echo $v['cname'];?></option>
                        <?php }?>
                    </select>
                </td>
                <td></td>
            </tr>

            </table>
            <!-- 货品列表 -->
            <table class="table2 lili">
                <tr>
                <th class="w100">货品列表</th>
                <td>
                    <select name="rid" class="w200">
                        <?php foreach ($data as $k=>$v){?>
                            <option value=" ">颜色</option>
                            <option value="<?php echo $v['cid'];?>"><?php echo $v['cname'];?></option>
                        <?php }?>
                    </select>
                </td>
                <td>
                    <select name="rid" class="w200">
                        <?php foreach ($data as $k=>$v){?>
                            <option value=" ">尺码</option>
                            <option value="<?php echo $v['cid'];?>"><?php echo $v['cname'];?></option>
                        <?php }?>
                    </select>
                </td>
                <td>
                    <input type="text" />
                </td>
                <td>
                    <input type="text" />
                </td>
            </tr>
            
        </table>
        <!-- 售后服务 -->
            <table class="table2 lili">
                <tr>
                    <!-- 商品详细 -编辑器-->
                
                    <td colspan="2">
                        <script id="editor2" type="text/plain" style="width:100%;height:300px;"></script>
                     </td>
                    
                </tr>
        
            
            </table>
        <div class="position-bottom">
            <input type="hidden" name="list_pic" id="list_pic"/>
            <input type="hidden" name="pr_small_pic" id="list_pic"/>
            <input type="hidden" name="pr_mid_pic" id="list_pic"/>
            <input type="hidden" name="pr_big_pic" id="list_pic"/>  
            <input type="submit" class="hd-success" value="添加"/>
        </div>
    </form>
</div>
</body>
</html>